// - post /login {username：'admin', 'password': 'admin'}
// - 颁发token
//      session ? cookie  传统  缺点
const Koa = require('koa')
const app = new Koa();
const router = require('koa-router')();
const bodyParser = require('koa-bodyparser');
const cors = require('koa-cors');
const authRouter = require('./routes/auth');
const testRouter = require('./routes/test')
app.use(cors());
app.use(bodyParser()); // 挡住post请求
router.use('/api/auth', authRouter)
router.use('/api/test', testRouter)
app.use(router.routes());

app.listen(1314);